Repository navigation
Stage 2: A_* error classes and RunInputs.section_digests() - #229
Merged
Merged
Conversation
Stage 2 design PR 2. ChannelNotFoundError carries A_SCOPE_INCOMPLETE (owner answer 2: one rule for a channel no image has and one some images lack; the message names the image). MaskNotInstancesError (A_MASK_NOT_INSTANCES) and RgbNotSupportedError (A_RGB_NOT_SUPPORTED) are shared classes for the bricks to raise, and all five analysis error classes are exported. section_digests() returns the manifest's description digests, or None without a description. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Scma6W3LC11s3qjXHZuGDm
# Conflicts: # CHANGELOG.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
ChannelNotFoundError.code = "A_SCOPE_INCOMPLETE".channel_indexnow names the image in its message and ends it with the code. The old text matchedPHASE.*DNA, ACTIN, and the new text still does.MaskNotInstancesError(A_MASK_NOT_INSTANCES) andRgbNotSupportedError(A_RGB_NOT_SUPPORTED). Both areRunInputsErrorsubclasses (aValueError) inrun_inputs_error.py, for the bricks to raise. Preprocessing checks neither.ChannelNotFoundError,MaskNotInstancesError,RgbNotSupportedError,DraftRefusedErrorandMaskUncheckedErrorare exported at the package top level and in__all__. The last two were not exported before; I added them so the five codes come as one set.RunInputs.section_digests()returns a copy ofmanifest.experiment_description["section_digests"](theconditions,channels,repeatsandmasksdigests). It returns None for a run without a description. It reads the manifest only, so it still works if the published file has since changed.RunInputssemantics) and a new §16 row, "Analysis refusals (Stage 2)", plus the CHANGELOG.Why
Stage 2 design, PR 2 (section 1.1). Owner answer 2: a channel no image has and a channel some images lack follow one rule, with one code that names the images. The classes live here as shared rules (D86) so no brick keeps its own copy of the code. Digests let a brick key a memo or cache on the section it depends on (for example the
repeatsdigest, design PR 12).Regression evidence
New
tests/test_a_error_classes.py(15 tests, 10 of them parametrized over the five classes):RunInputsErrorwith itscode, is exported, and carries the code in its message.code(a worker process may raise them).RunInputsError.codestaysNone.channel_indexraisesA_SCOPE_INCOMPLETEnaming the image, byFovand by path.section_digests. The result is a copy, and None without a description.On
mainthe whole file fails at collection (the new classes andsection_digestsdo not exist;ChannelNotFoundError.codeisNone), so 0 of 15 run. With the change, 15 pass.tests/test_run_inputs_semantic.pyis unchanged and still passes.Checks
python tools/check.py: ruff check and format clean, 4603 passed, 4 skipped, code rules clean. The 4 skips are environmental: 3 need a case-sensitive-name file system check (test_cli_log.py:165,test_folder_rules.py:201and:229) and 1 needs file modes to apply (test_discovery.py:665, running as root).Needs an owner decision
channel_indexis per image, so it names that one image. The scope-level message and its check belong to the bricks (design PR 10, 16, 17), unless you want a helper here (the Stage 1channel_availability(), deferred to Stage 3).RunInputsErrorsubclasses, whose docstring says "run preprocessing again". That is the established pattern (DraftRefusedError,MaskUncheckedError), so I followed it. If a brick-raised refusal should not be aRunInputsError, say so.DraftRefusedErrorandMaskUncheckedErrorwas my addition.🤖 Generated with Claude Code
https://claude.ai/code/session_01Scma6W3LC11s3qjXHZuGDm